/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: Sum.java
 * @Time: 2022/11/30 16:12
 * @Author: abcque
 * @Description: 计算 1+2+3+...+10 的和
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class SumV1 {
    public static void main(String[] args) {
        // step1、定义变量保存和 sum
        int sum;

        // step2、计算和
        int i;

        i = 1;
        sum = 0;

        // 调整计算公式，使其具有可重复性
        sum = sum + i;

        i = 2;
        sum = sum + i;

        i = 3;
        sum = sum + i;

        i = 4;
        sum = sum + i;

        i = 5;
        sum = sum + i;

        i = 6;
        sum = sum + i;

        i = 7;
        sum = sum + i;

        i = 8;
        sum = sum + i;

        i = 9;
        sum = sum + i;

        i = 10;
        sum = sum + i;

        System.out.println(sum);
    }
}
